package net.zjitc.service.impl;

import net.zjitc.mapper.UserMapper;
import net.zjitc.pojo.User;
import net.zjitc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author admin
 * @Date 2019/3/27 14:47
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public void register(User user) {
       userMapper.register(user);
    }

    @Override
    public User login(String username, String password) {
        User user = userMapper.login(username,password);
        if(user != null && user.getPASSWORD().equals(password)){
            return user;
        }
        return null;
    }
}
